﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CompoundCondition.cs" company="Microsoft">
//   Microsoft
// </copyright>
// <summary>
//   Defines the CompoundCondition type.
// </summary>
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
// ----------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
// --------------------------------------------------------------------------------------------------------------------

namespace MySemanticSearch.Web.QueryBuilder.Conditions
{
    /// <summary>
    /// An abstract condition to build composite conditions
    /// </summary>
    public abstract class CompoundCondition : ICondition
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CompoundCondition"/> class.
        /// </summary>
        /// <param name="left">
        /// The left condition
        /// </param>
        /// <param name="right">
        /// The right condition
        /// </param>
        protected CompoundCondition(ICondition left, ICondition right)
        {
            this.LeftCondition = left;
            this.RightCondition = right;
        }

        /// <summary>
        /// Gets or sets LeftCondition.
        /// </summary>
        protected ICondition LeftCondition { get; set; }

        /// <summary>
        /// Gets or sets RightCondition.
        /// </summary>
        protected ICondition RightCondition { get; set; }

        /// <summary>
        /// Gets a composite condition
        /// </summary>
        /// <returns>
        /// The condition in form of a string
        /// </returns>
        public abstract string GetCondition();
    }
}